<template>
	<view class="main">
		<view class="swiperV">
			<uv-swiper :list="venueInfo" indicator indicatorMode="line" circular height="374rpx" radius="0"></uv-swiper>
		</view>
		<view class="searchV">
			<uv-search v-model="searchValue" :showAction="true" placeholder="搜索医生、科室、疾病" actionText="搜索"
				:animation="true"></uv-search>
		</view>
		<view class="info" @click="openH">
			<view class="infol">二甲</view>
			<view class="infoc">沁水县人民医院</view>
			<view class="infor">医院介绍 > </view>
		</view>
		<view class="menusV">
			<view class="menusVi" v-for="(i,o) in userInfo.currentVersion == 1? menusList:menusListDoc" :key="o"
				@click="openPath(i.path)" :style="{'background':`linear-gradient(45deg,${i.color}22,${i.color}66)`}">
				<img :src="i.icon" />
				<view class="menusVic">
					<view class="menusVict">{{i.name}}</view>
					<view class="menusVicb">{{i.content}}</view>
				</view>
			</view>
			<view class="menusVi" style="background:linear-gradient(45deg,#0066CC22,#0066CC66)">
				<view class="menusVic menusVicMore">
					<view class="menusVict">更多内容，</view>
					<view class="menusVict">敬请期待</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				venueInfo: [
					"https://www.ysrs.xyz/apiI/ll/file/preview/1743073096623ff80808195d597d90195d740b3af0001.jpg",
				],
				searchValue: '',
				menusList: [{
						name: '预约挂号',
						content: '在线预约挂号',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073564874ff80808195d597d90195d747d8ca000e.png',
						color: '#FFFFCC',
						path: '/pages/AppointmentRegistration/AppointmentRegistration?type=1'
					},
					{
						name: '报告查询',
						content: '报告查询查看',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073550785ff80808195d597d90195d747a1c1000d.png',
						color: '#CCFFFF',
						path: '/pages/Reportnquiry/Reportnquiry'
					},
					{
						name: '电子病历',
						content: '患者诊疗记录',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073522391ff80808195d597d90195d74732d7000c.png',
						color: '#FFCCCC',
						path: '/pages/ElectronicMedicalRecord/ElectronicMedicalRecord'
					},
					{
						name: '导诊',
						content: '精准清晰快捷',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073501979ff80808195d597d90195d746e31b000b.png',
						color: '#FFCCCC',
						path: '/pages/HospitalizationGuidance/HospitalizationGuidance'
					},
					{
						name: '在线问诊',
						content: '医患沟通指导',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073467397ff80808195d597d90195d7465c05000a.png',
						color: '#d7d5ff',
						path: '/pages/AppointmentRegistration/AppointmentRegistration?type=2'
					},
					{
						name: '在线缴费',
						content: '线上费用缴纳',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073453624ff80808195d597d90195d74626380009.png',
						color: '#CCFFCC',
						path: '/pages/OnlinePayment/OnlinePayment'
					},
					{
						name: 'AI问诊',
						content: '智慧门诊服务',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073442240ff80808195d597d90195d745f9c00008.png',
						color: '#FFCC99',
						path: '/pages/AiConsultation/AiConsultation'
					},
					{
						name: '科室导航',
						content: '就诊引导服务',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073424564ff80808195d597d90195d745b4b40007.png',
						color: '#afeaea',
						path: '/pages/DepartmentNavigation/DepartmentNavigation'
					},
					{
						name: '健康咨询',
						content: '解除健康问题',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743073403872ff80808195d597d90195d74563e00006.png',
						color: '#b2eeb2',
						path: '/pages/HealthCounseling/HealthCounseling'
					},
				],
				menusListDoc: [{
						name: '科室管理',
						content: '科室管理',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743427619832ff80808195d597d90195ec624bf8001e.png',
						color: '#FFFFCC',
						path: '/pages/AppointmentRegistration/AppointmentRegistration?type=1'
					},
					{
						name: '医生管理',
						content: '医生管理',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743427633563ff80808195d597d90195ec62819c001f.png',
						color: '#CCFFFF',
						path: '/pages/Reportnquiry/Reportnquiry'
					},
					{
						name: '排班管理',
						content: '排班管理',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743427743476ff80808195d597d90195ec642ef40023.png',
						color: '#FFCCCC',
						path: '/pages/ElectronicMedicalRecord/ElectronicMedicalRecord'
					},
					{
						name: '患者管理',
						content: '患者管理',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743427671491ff80808195d597d90195ec6315c30022.png',
						color: '#FFCCCC',
						path: '/pages/HospitalizationGuidance/HospitalizationGuidance'
					},
					{
						name: '病人管理',
						content: '病人管理',
						icon: 'https://www.ysrs.xyz/apiI/ll/file/preview/1743427660814ff80808195d597d90195ec62ec0e0021.png',
						color: '#d7d5ff',
						path: '/pages/AppointmentRegistration/AppointmentRegistration?type=2'
					},
				],
				userInfo: {},
			}
		},
		onShow() {
			this.userInfo = uni.getStorageSync('userInfo') || null
			console.log(this.userInfo)
		},
		mounted() {},
		methods: {
			openH() {
				uni.navigateTo({
					url: '/pages/index/info'
				})
			},
			openPath(path) {
				const userInfo = uni.getStorageSync('userInfo') || null
				if (!userInfo) {
					uni.showToast({
						title: '请登录！',
						duration: 1000,
						icon: 'none'
					})
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/personal/login'
						})
					}, 1000)
					return;
				} else {
					uni.navigateTo({
						url: path
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		background-color: #F5F5F5;
		min-height: 100vh;

		.searchV {
			display: flex;
			align-items: center;
			justify-content: space-around;
			width: 660rpx;
			height: 100rpx;
			padding: 0 30rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(0, 0, 0, 0.15);
			border-radius: 16rpx;
			margin: -40rpx auto 0;
			position: relative;
			z-index: 9;
		}

		.info {
			display: flex;
			align-items: center;
			padding: 0 30rpx;
			width: 100%;
			margin: 30rpx 0;

			.infol {
				background-color: #fe7102;
				width: 80rpx;
				height: 40rpx;
				text-align: center;
				line-height: 40rpx;
				border-radius: 8rpx;
				font-size: 22rpx;
				color: #fff;
			}

			.infoc {
				font-size: 44rpx;
				font-weight: bold;
				margin: 0 150rpx 0 30rpx;
			}

			.infor {
				font-size: 28rpx;
				color: #409EFF;
			}
		}

		.menusV {
			display: flex;
			width: 660rpx;
			padding: 10rpx 30rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(0, 0, 0, 0.15);
			flex-wrap: wrap;
			margin: 20rpx auto 0;
			border-radius: 16rpx;

			.menusVi {
				width: 275rpx;
				display: flex;
				align-items: center;
				background: #FFFFFF;
				border-radius: 16rpx;
				margin: 20rpx 0;
				box-shadow: 0rpx 0rpx 16rpx rgba(0, 0, 0, 0.15);
				padding: 20rpx;

				&:nth-of-type(2n-1) {
					margin-right: 30rpx;
				}

				img {
					width: 100rpx;
					height: 100rpx;
					margin-right: 20rpx;
				}

				.menusVic {
					text-shadow: 0 0 6rpx #ccc;

					.menusVict {
						font-weight: bold;
						color: #333;
						font-size: 32rpx;
						margin-bottom: 20rpx;
					}

					.menusVicb {
						color: #666;
						font-size: 23rpx;
					}
				}

				.menusVicMore {
					width: 100%;

					.menusVict {
						margin-left: 30rpx;
						color: #fff;
						text-shadow: 0 0 8rpx #333;

						&:last-of-type {
							margin: 0;
							margin-right: 30rpx;
							text-align: right;
						}
					}
				}
			}
		}
	}

	/deep/.uv-swiper__indicator {
		bottom: 60rpx !important;
		left: 40rpx !important;
	}
</style>